<?php
    header('content-type:text/html;charset=utf-8');
    
    include("./../dbconn.php");

    $userName = $_GET["userName"];
    $tel = $_GET["tel"];
    $password = $_GET["password"];
    $sex = $_GET["sex"];
    $age = $_GET["age"];

    $sql = "insert into member (userName, tel, password, sex, age) values ('$userName', '$tel', '$password', '$sex', '$age')";

    if($conn -> query($sql) === true){
        // 成功
        $result["errCode"] = 0;
    }else{
        // 失败
        $result["errCode"] = 1;
    }

    echo json_encode($result);
?>